<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../static/userinfoPrivate/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../static/css/thesame.css" media="all">
    <link rel="stylesheet" href="../static/css/footer.css" media="all">
    <link rel="stylesheet" href="../static/css/drugs/rightCon.css" media="all">
    <style>
    </style>
</head>

<body class="layui-layout-body">
<div class="layui-body">
    <div class="add-title pad25px"><span class="mr10px cursor return"><img src="../static/img/return_icon.png"></span><span>药物发放详情</span></div>
    <div class="new-add-box new-add-box-width bgWhite box-shadows border-radius4">
        <div class="add-box-scroll">
            <div class="mar25px">
                <ul class="lh45px">
                    <li>
                        <span class="fb">药物名称：</span><em id="meicineName"></em>
                    </li>
                    <li>
                        <span class="fb">剂量：</span><em id="meicineDosage"></em>
                    </li>
                    <li class="overflow">
                        <div class="left"><span class="fb">服药时间：</span></div>
                        <div class="left">
                            <p id="morning">
                                <span class="mr20px">早上8点</span>
                                <span id="morningCount"></span>
                            </p>
                            <p id="noon">
                                <span class="mr20px">中午12点</span>
                                <span id="noonCount"></span>
                            </p>
                            <p id="afternoon">
                                <span class="mr20px">下午4点</span>
                                <span id="afternoonCount"></span>
                            </p>
                            <p id="night">
                                <span class="mr20px">晚上8点</span>
                                <span id="nightCount"></span>
                            </p>
                        </div>
                    </li>
                    <li>
                        <span class="fb">开始时间：</span><em id="startDate"></em>
                    </li>
                    <li>
                        <span class="fb">结束时间：</span><em id="endDate"></em>
                    </li>
                    <li>
                        <span class="fb">备注：</span><em id="remark"></em>
                    </li>
                    <li>
                        <span class="fb">经办人：</span><em id="userNo"></em>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class="layui-footer layui-footer-one">
    <div class="btn-con textCenter">
        <span class="btn-one cursor return">返&nbsp;回</span>
    </div>
</div>
<script src="../static/js/jquery-2.1.3.min.js"></script>
<script src="../static/layui/layui.js" charset="utf-8"></script>
<script th:inline="javascript">

    $(function () {
        $(".return").click(function () {
            window.history.back();
        })

        getData();
    });

    var id = [[${id}]]

    function getData() {
        var data = {id: id};
        $.ajax({
            url: "../meicinedistribution/getMeicineDistributionById",
            type: "get",
            async: false,
            dataType: "json",
            data: data,
            success: function (data) {
                if (data.code == 200) {
                    if (isNull(data.data.morningCount)) {
                        $("#morning").css("display", "none");
                    }
                    if (isNull(data.data.noonCount)) {
                        $("#noon").css("display", "none");
                    }
                    if (isNull(data.data.afternoonCount)) {
                        $("#afternoon").css("display", "none");
                    }
                    if (isNull(data.data.nightCount)) {
                        $("#night").css("display", "none");
                    }
                    $("#meicineName").text(data.data.meicineName)
                    $("#meicineDosage").text(data.data.meicineDosage)
                    $("#morningCount").text(data.data.morningCount)
                    $("#noonCount").text(data.data.noonCount)
                    $("#afternoonCount").text(data.data.afternoonCount)
                    $("#nightCount").text(data.data.nightCount)
                    $("#startDate").text(data.data.startDate)
                    $("#endDate").text(data.data.endDate)
                    $("#remark").text(data.data.remark)
                    $("#userNo").text(data.data.tellerNo)
                }
            }
        })
    }

    function isNull(value) {
        return value == null || value === "" || value === undefined;
    }
</script>
</body>

</html>
